//
//  InterstitialAdM.m
//  TestDemo
//
//  Created by a on 2023/2/2.
//

#import "InterstitialAdM.h"

@interface InterstitialAdM ()<LDInterstitialAdDelegate>

@end

@implementation InterstitialAdM

- (void)setupAd{
    [LDSDKConfig setAppKey:@"f7d19924efe93778" token:@"cvvcqdnyrk"];
    self.ad = [[LDInterstitialAd alloc]initWithSlotID:@"3191736"];
    self.ad.viewController = self.viewController;
    self.ad.delegate = self;
}

- (void)loadAdShow{
    self.ad.viewController = self.viewController;
    [self.ad loadAndShow];
}

- (void)loadAd{
    [self.ad loadAd];
}

- (void)showAd{
    self.ad.viewController = self.viewController;
    [self.ad showAd];
}

#pragma mark -LDInterstitialAdDelegate
/// 插屏加载完成
/// @param interstitialAd 插屏实例
- (void)interstitialAdDidLoad:(id)interstitialAd{
    NSLog(@"---------%@",NSStringFromSelector(_cmd));
}
/// 插屏加载失败
/// @param error 错误实例
- (void)interstitialAdFailedToLoad:(id)interstitialAd error:(NSError *)error{
    NSLog(@"---------%@",NSStringFromSelector(_cmd));
}
/// 插屏触发点击
- (void)interstitialAdClick:(id)interstitialAd{
    NSLog(@"---------%@",NSStringFromSelector(_cmd));
}
/// 插屏出发关闭
- (void)interstitialAdClose:(id)interstitialAd{
    NSLog(@"---------%@",NSStringFromSelector(_cmd));
}
///插屏曝光
- (void)interstitialAdDidExposure:(id)interstitialAd{
    NSLog(@"---------%@",NSStringFromSelector(_cmd));
}

- (void)dealloc{
    NSLog(@"InterstitialAdM dealloc");
}
@end

